package com.lanlian.commonlib.bean.db;

import com.lanlian.commonlib.dao.DBManager;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.List;

/**
 * <pre>
 *     author : huxiaobo
 *     e-mail : huxiaobo@xlanlian.com
 *     date   : 2018/8/21 10:02
 *     desc   : 市场搜索缓存类
 *     version: 1.0
 * </pre>
 */
@Entity
public class DBMarketS {

    @Id
    private String id;
    private String name;
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    @Generated(hash = 1677187256)
    public DBMarketS(String id, String name) {
        this.id = id;
        this.name = name;
    }
    @Generated(hash = 1037280928)
    public DBMarketS() {
    }


    public  static   boolean isHas(String id)
    {
        boolean b=false;
        List<DBMarketS> list= DBManager.getInstance().getMarketS();
        if(list!=null)
        {
            for(int i=0;i<list.size();i++)
            {
                if(id.equals(list.get(i).getId()))
                {
                    b=true;
                    break;
                }
            }
        }
        return  b;
    }
}
